<template>
    <div class="ctbsc-list">
        <van-card v-for="good in goods" @click="detail(good.id)"
                  :num="good.num"
                  :price="good.price"
                  :desc="good.description"
                  :title="good.title"
                  :thumb="good.cover"
        />
    </div>
</template>

<script>

export default {
    name: "GoodsList",
    data(){
        return{
            goods:[],
        }
    },
    methods:{

        detail(id){
            this.$router.push({path:'/detail',query:{'id':id}})
        },

        getGoodList(){
           this.$myGetHttp(this.$myUrl.goodsLst).then(res=>{
               this.goods = res.records
               console.log(this.goods)
           })
        }
    },
    mounted() {
        this.getGoodList()
    }

}
</script>

<style lang="less" scoped>
    .ctbsc-list {
        padding: 0px 5px;
        background: #f7f8fa;
        min-height: 100vh;
        margin-top:20px
    }

    .van-card__title {
        max-height: 8.53333vw;
        font-weight: 1000;
        line-height: 4.26667vw;
        font-size: larger;
        margin-top:10px
    }
    .van-card__desc {
        margin-top:5px
    }
</style>
